package com.joshluisaac.simple;

public class Bicycle {

	/**
	 * NON STATIC OR INSTANCE VARIABLES cadence, speed and gear are instance
	 * variables because their values are unique and specific to each instance
	 * of the class. For example, the cadence, speed and gear of object bicycleA
	 * is different from those of bicycleB which isn't same as those of
	 * bicycleC. Refer to BicycleDemo class.
	 * 
	 * CLASS OR STATIC VARIABLES These are variables belonging to the class
	 * regardless of how many instances of the class is created. For example,
	 * the number of gears of a bicycle will always remain same regardless of
	 * how many instances or objects are created.
	 */

	int cadence = 0;
	int speed = 0;
	int gear = 1;
	private static int numGears = 6;
	static final int numGears2 = 7;

	public Bicycle() {
		System.out.println("Parent constructor: Bicycle");
	}

	/**
	 * @return the numGears
	 */
	public static int getNumGears() {
		return numGears;
	}

	/**
	 * @param numGears
	 *            the numGears to set
	 */
	public static void setNumGears(int numGears) {
		Bicycle.numGears = numGears;
	}

	public void changeCadence(int cadence) {
		this.cadence = cadence;
	}

	public void changeGear(int gear) {
		this.gear = gear;
	}

	public void increaseSpeed(int incrementingValue) {
		this.speed = speed + incrementingValue;
	}

	public void decreaseSpeed(int decrementingValue) {
		this.speed = speed - decrementingValue;
	}

	public void printStates() {
		System.out.println("cadence: " + cadence + " speed: " + speed
				+ " gear: " + gear);
	}

}
